home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 …ember: Reference Library / Dev.CD Dec 94.toast / Technical Documentation / PCI Information / PCI Developer’s Kit (disk) / Open Firmware / SCSI example / overall.of < prev    next >
Encoding:
Text File  |  1994-06-27  |  1.4 KB  |  46 lines  |  [TEXT/EDIT]

  1. \ FCode driver for hypothetical SCSI host adapter
  2.  
  3. FCode-version1
  4.  
  5. hex
  6.  
  7. " XYZI,scsi"          name          \ Name of device node
  8. " XYZI,12346-01"      model         \ Manufacturer's model number
  9. " scsi-2"             device-type   \ Device implements SCSI-2 method set
  10. 3 0                   intr          \ Device interrupts on level 3, no vector
  11.  
  12. external
  13.  
  14. \ These routines may be called by the children of this device.
  15. \ This card has no local buffer memory for the SCSI device, so it
  16. \ depends on its parent to supply DMA memory.  For a device with
  17. \ local buffer memory, these routines would probably allocate from
  18. \ that local memory.
  19.  
  20. : dma-alloc    ( n -- vaddr )  " dma-alloc" $call-parent  ;
  21. : dma-free     ( vaddr n -- )  " dma-free" $call-parent  ;
  22. : dma-sync     ( vaddr devaddr n -- )  " dma-sync" $call-parent  ;
  23. : dma-map-in   ( vaddr n cache? -- devaddr )  " dma-map-in" $call-parent  ;
  24. : dma-map-out  ( vaddr devaddr n -- )  " dma-map-out" $call-parent  ;
  25. : max-transfer ( -- n )
  26.    " max-transfer"  ['] $call-parent catch  if  2drop h# 7fff.ffff  then
  27.    \ The device imposes no size limitations of its own; it it did, those
  28.    \ limitations could be described here, perhaps by executing:
  29.    \    my-max-transfer min
  30. ;
  31.  
  32.  
  33. fload scsiha.fth
  34.  
  35. fload hacom.fth
  36.  
  37.    new-device
  38.       fload scsidisk.fth    \ scsidisk.fth also loads scsicom.fth
  39.    finish-device
  40.  
  41.    new-device
  42.       fload scsitape.fth    \ scsitape.fth also loads scsicom.fth
  43.    finish-device
  44.  
  45. end0
  46.